package cn.wolfcode.luowowo.test;

import lombok.Setter;

//枚举类   特点;构造器私有化,外界不能创建对象  实例对象是固定的
public enum MyDate {
    //实例对象
    DATE1, DATE2, DATE3
}

enum MyDate2 {
    //实例化对象  带有参数
    DATE4("王者"), DATE5("美梦");

    @Setter
    private String name;

    private MyDate2(String name) {
        this.name = name;
    }
}

//其实枚举类可以这么理解
class MyDateClass {
    public static final MyDateClass DATE6 = new MyDateClass("好梦");

    @Setter
    private String name;

    private MyDateClass(String name) {
        this.name = name;
    }
}

